<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');
            $table->string('username')->nullable()->comment('[v1.0]登录用户名');
            $table->string('email')->nullable()->unique()->comment('[v1.0]邮箱');
            $table->timestamp('email_verified_at')->nullable()->comment('[v1.0]邮箱确认时间');
            $table->string('password')->nullable()->comment('[v1.0]密码');
            $table->string('nickname',60)->nullable()->comment('[v1.0]用户昵称');
            $table->string('phone',13)->nullable()->comment('[v1.0]手机号码');
            $table->string('avatar')->nullable()->comment('[v1.0]用户头像图片的URL');
            $table->tinyInteger('gender')->default(0)->comment('[v1.0]用户性别0	未知;1 男性; 2 女性');
            $table->string('city')->nullable()->comment('[v1.0]用户所在城市');
            $table->string('province')->nullable()->comment('[v1.0]用户所在省');
            $table->string('country')->nullable()->comment('[v1.0]用户所在国家');
            $table->tinyInteger('current_address_id')->default(0)->comment('[v1.0]当前使用的地址的id');
            $table->tinyInteger('state')->unsigned()->default(1)->comment('[v1.0]会员状态 0 关闭 1开启');
            $table->rememberToken();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
